#!/bin/bash

# Source ROS setup script
source /opt/ros/noetic/setup.zsh

# Specify the topics you want to record
TOPICS="/mavros/px4flow/raw/optical_flow_rad /nlink_linktrack_nodeframe3 /mavros/imu/data /mavros/vision_pose/pose /mavros/vision_pose/odom /mavros/local_position/pose /mavros/local_position/odom /IMU_data /csj01/mocap/acc /csj01/mocap/vel /csj01/mocap/pos /uwb01/mocap/acc /uwb01/mocap/vel /uwb01/mocap/pos /uwb02/mocap/acc /uwb02/mocap/vel /uwb02/mocap/pos /uwb03/mocap/acc /uwb03/mocap/vel /uwb03/mocap/pos /uwb04/mocap/acc /uwb04/mocap/vel /uwb04/mocap/pos mavros/state mavros/setpoint_position/local /estimated/xt_real/pose /estimated/xt_real/vel /estimated/used/imu /estimated/used/uwb /estimated/used/dt /estimated/sensor/uwb /estimated/param/uwb /rosbag/xt_real/pose /rosbag/xt_real/vel /rosbag/used/imu /rosbag/used/uwb /rosbag/used/dt /rosbag/sensor/uwb /rosbag/param/uwb"

# Set the output bag file name to the current date and time (精确到分钟)
OUTPUT_BAG_FILE=$(date +"/home/scarlett/record_bag/testcl/uwb.bag")

# Your rosbag record command here
rosbag record $TOPICS -o $OUTPUT_BAG_FILE
